import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

export default new VueRouter({
    routes: [
        {
            // 教育主页
            path: "/home",
            name: "home",
            component: () => import("@/views/home/home"),
            redirect: '/home/system',
            children: [
                {
                    /*
                    * 学习体系
                    * */
                    path: 'system',
                    name: 'system',
                    meta: { x: 0, y: 0, index: 1 },
                    component: () => import('@/views/home/system/system')
                },
                {
                    /*
                    * 发现
                    * */
                    path: 'discover',
                    name: 'discover',
                    meta: { x: 0, y: 0 },
                    component: () => import('@/views/home/discover/discover')
                },
                {
                    /*
                    * 我的
                    * */
                    path: 'mine',
                    name: 'mine',
                    meta: { index: 1 },
                    component: () => import('@/views/home/mine/mine')
                }
            ]
        },
        {
            /*
            * 课程列表
            * */
            path: "/courselist",
            name: "courseList",
            meta: { index: 2 },
            component: () => import("@/views/home/course/courseList")
        },
        {
            /*
            * 课程详情
            * */
            path: "/coursedetail",
            name: "courseDetail",
            meta: { index: 3 },
            component: () => import("@/views/home/course/courseDetail")
        },
        {
            /*
            * 课程信息
            * */
            path: '/courseinfo',
            name: 'courseInfo',
            meta: { index: 4 },
            component: () => import("@/views/home/course/courseInfo")
        },
        {
            /*
            * 我的信息
            * */
            path: '/minedetails',
            name: 'mineDetails',
            meta: { index: 2 },
            component: () => import("@/views/home/mine/mineDetails")

        }
    ]
});